package cn.huaqingcheng.tool.http.spi;

import org.jetbrains.annotations.NotNull;

/**
 * HTTP 客户端提供
 **/
public interface HttpClientProvide extends Comparable<HttpClientProvide> {

    @Override
    default int compareTo(@NotNull HttpClientProvide o) {
        return getOrder() - o.getOrder();
    }

    /**
     * 排序优先级; 升序取最小值;
     *
     * @see #compareTo(HttpClientProvide)
     */
    default int getOrder() {
        return Integer.MAX_VALUE;
    }

    /**
     * 获取的一个新客户端实例
     */
    HttpClient getClient();

}
